package com.itheima.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.pojo.OrderSetting;
import com.itheima.service.ClenUpService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;


@Component
public class ClenUpController {
    @Reference
    ClenUpService clenUpService;
/* @Scheduled(cron = "0 0 0 1 * ?")  //每个月一号0点*/
    @Scheduled(fixedDelay = 5000)
    public void clenup(){

        String orderDate = "2019-03-19";
       //定义日期
//        String orderDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        System.out.println(orderDate);
        //删除
        Integer clens= clenUpService.delete(orderDate);
        System.out.println(clens);

    }


}
